import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/Layout/index.vue'

// 全局注册
Vue.use(VueRouter)
// 配置路由规则
const routes = [
 {
  path:'/login',
  name:'login',
  component:()=>import('../views/login/index.vue')
 },
 {
  path:"/",
  component:Layout,
  // 重定向  强制跳转到以下页面
  redirect:"dashboard",
  children:[
    // 数据看板
    {
      path:'dashboard',
      name:'dashboard',
      component:()=>import('@/views/dashboard/index.vue')
    },
    // 面经管理
    {
      path:'article',
      name:'article',
      component:()=>import('@/views/article/index.vue')
    },
     ]
 },
 
 
]
// 根据路由规则实例化路有对象
const router = new VueRouter({
  routes
})
// 导出
export default router
